<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            color: #e6e6e6;
        }

        .login-container {
            background: rgba(25, 25, 35, 0.8);
            padding: 40px;
            border-radius: 15px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
            width: 350px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .login-container h2 {
            text-align: center;
            margin-bottom: 30px;
            color: #64c8ff;
            font-weight: 300;
            letter-spacing: 1px;
        }

        .form-group {
            margin-bottom: 25px;
            position: relative;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #a0a0c0;
            font-size: 14px;
        }

        .form-group input {
            width: 100%;
            padding: 12px 15px;
            border: none;
            border-radius: 8px;
            background: rgba(45, 45, 65, 0.7);
            color: #ffffff;
            box-sizing: border-box;
            border: 1px solid rgba(100, 200, 255, 0.2);
            transition: all 0.3s ease;
        }

        .form-group input:focus {
            outline: none;
            border-color: #64c8ff;
            box-shadow: 0 0 15px rgba(100, 200, 255, 0.3);
        }

        .login-btn {
            width: 100%;
            padding: 12px;
            background: linear-gradient(135deg, #64c8ff 0%, #3a86ff 100%);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 500;
            letter-spacing: 1px;
            transition: all 0.3s ease;
            margin-top: 10px;
        }

        .login-btn:hover {
            background: linear-gradient(135deg, #3a86ff 0%, #64c8ff 100%);
            box-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
            transform: translateY(-2px);
        }

        .login-btn:active {
            transform: translateY(0);
        }

        .glowing-border {
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            border-radius: 10px;
            background: linear-gradient(45deg, #64c8ff, #3a86ff, #64c8ff);
            z-index: -1;
            animation: glowing 3s ease infinite;
        }

        @keyframes glowing {
            0% { filter: blur(5px); opacity: 0.7; }
            50% { filter: blur(10px); opacity: 1; }
            100% { filter: blur(5px); opacity: 0.7; }
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="glowing-border"></div>
    <h2>用户登录</h2>
    <form id="form" >
        <div class="form-group">
            <label for="username">账号:</label>
            <input type="text" id="username" name="name" placeholder="请输入用户名" required>
        </div>
        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" id="password" name="pass" placeholder="请输入密码" required>
        </div>
        <button type="button" class="login-btn" onclick="login()">登录</button>
    </form>
</div>
</body>
<script src="/js/jquery.min.js"></script>
<script>
    function login(){
        var un = $("#username").val();
        var password = $("#password").val();
        if (un == "" || password == "") {
            alert("请填写账号和密码");
            return;
        }
        $.ajax({
            url: "/minshuo/user/tologin",
            type: "POST",
            data: {
                name: un,
                pass: password
            },
            success: function (data) {
                if (data == 1) {
                    window.location.href = "/minshuo/course/view";
                } else {
                    alert("账号密码错误");
                }
            }
        })
    }
</script>
</html>

